<!DOCTYPE html>
<html>

<head>
	<meta charset="utf-8" />
	<title>我的</title>
	<meta name="viewport"
		content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
	<meta name="format-detection" content="telephone=no,email=no,date=no,address=no" />
	<link rel="stylesheet" type="text/css" href="../css/api.css" />
	<link href="../css/myhome/style.css" rel="stylesheet" type="text/css" />
	<style>
		.body {
			height: 100%;
		}
	</style>
</head>

<body>
	<section class="jq22-flexView">
		<section class="jq22-scrollView">
			<div class="jq22-mine-box">
				<div class="jq22-flex jq22-flexbg">
					<div class="jq22-user-img" onclick="showAction()">
						<img id="img_src" name="avatar" src="../image/1234.png" width="100px;" />
					</div>
					<div class="jq22-flex-box">
						<h2 id="name" onclick="openDetail('./videos/video_list_wim.html')"></h2>
						<br />
						<!-- <span>所见项目:&nbsp;&nbsp;&nbsp;</span
							><span id="" style="margin-right: 10px;"></span> -->
						<span>软件版本:&nbsp;&nbsp;</span>
						<span id="info" style="margin-right: 10px;"></span>
						<br />
						<span>角色类型:&nbsp;&nbsp;</span>
						<span id="role" style="margin-right: 10px;"></span>
					</div>
					<!--<div class="jq22-arrow" onclick="openDetail('personal_window.html')">
						<span>个人信息</span>
						</div>-->
				</div>
				<!--<div class="jq22-flex jq22-flex-one">
					<div class="jq22-flex-box">
					<div class="jq22-mine-cell">
					<h2>我的公司</h2>
					<p>
					临沂城投思索信息技术有限公司
					</p>
					</div>
					</div>
					<div class="jq22-flex-box">
					<div class="jq22-mine-cell jq22-mine-cell-one">
					<h2>代办列表</h2>
					<p>
					你的代办事项
					</p>
					</div>
					</div>
					</div>-->
				<div class="divHeight"></div>
				<div class="jq22-mine-list">
					<div class="divHeight"></div>
					<!--	<a href="javascript:;" class="jq22-flex b-line">
						<div class="jq22-cou-img">
						<img src="../image/myhome/icon-item-002.png" alt="">
						</div>
						<div class="jq22-flex-box">
						<p>
						我的
						</p>
						</div>
						<div class="jq22-arrow">
						<span>xx</span>
						</div> </a>
						<a href="javascript:;" class="jq22-flex b-line">
						<div class="jq22-cou-img">
						<img src="../image/myhome/icon-item-003.png" alt="">
						</div>-->
					<!--	<div class="jq22-flex-box">
						<p>
						我的
						</p>
						</div>
						<div class="jq22-arrow">
						<span></span>
						</div> </a>
						<a href="javascript:;" class="jq22-flex b-line">
						<div class="jq22-cou-img">
						<img src="../image/myhome/icon-item-004.png" alt="">
						</div>
						<div class="jq22-flex-box">
						<p>
						我的
						</p>
						</div>
						<div class="jq22-arrow">
						<span></span>
						</div> </a>
						<a href="javascript:;" class="jq22-flex b-line">
						<div class="jq22-cou-img">
						<img src="../image/myhome/icon-item-005.png" alt="">
						</div>
						<div class="jq22-flex-box">
						<p>
						我的
						</p>
						</div>
						<div class="jq22-arrow">
						<span></span>
						</div> </a>
						<div class="divHeight"></div>
						<a href="javascript:;" class="jq22-flex b-line">
						<div class="jq22-cou-img">
						<img src="../image/myhome/icon-item-006.png" alt="">
						</div>
						<div class="jq22-flex-box">
						<p>
						我的
						</p>
						</div>
						<div class="jq22-arrow">
						<span></span>
						</div> </a>
						<a href="javascript:;" class="jq22-flex b-line">
						<div class="jq22-cou-img">
						<img src="../image/myhome/icon-item-007.png" alt="">
						</div>
						<div class="jq22-arrow" id="ld">
						<span style="font-size: 10px;margin-left: 5px"  v-for="(l,index) in ld" v-text="l.projectName"></span>
						</div> </a>-->
					<a href="javascript:;" class="jq22-flex b-line" onclick="tongzi()">
						<div class="jq22-cou-img">
							<img src="../image/myhome/tz.png" alt="" />
						</div>
						<div class="jq22-flex-box">
							<p>
								通知列表
							</p>
						</div>
						<div class="jq22-arrow">
							<span></span>
						</div>
					</a>
					<a href="javascript:;" class="jq22-flex b-line" onclick="openDetail('./terms_window.html')">
						<div class="jq22-cou-img">
							<img src="../image/tanhao.png" alt="" />
						</div>
						<div class="jq22-flex-box">
							<p>
								服务协议&隐私政策
							</p>
						</div>
						<div class="jq22-arrow">
							<span></span>
						</div>
					</a>

					<a href="javascript:;" class="jq22-flex b-line" id="tuichu">
						<div class="jq22-cou-img">
							<img src="../image/myhome/icon-item-008.png" alt="" />
						</div>
						<div class="jq22-flex-box">
							<p>
								退出系统
							</p>
						</div>
						<div class="jq22-arrow">
							<span></span>
						</div>
					</a>
				</div>
			</div>
		</section>
	</section>
</body>
<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript" src="../script/common.js"></script>
<script type="text/javascript" src="../script/vue.js"></script>
<script type="text/javascript" src="../script/jquery-1.11.0.min.js"></script>
<script src="../script/webuploader.min.js"></script>
<script src="../script/diyUpload.js"></script>
<script type="text/javascript">
	apiready = function () {
		//用户信息
		var user = $api.getStorage("userSession").data;
		//console.log(JSON.stringify(user));
		document.getElementById("name").innerHTML = user.name;
		if (user.protrait !== null) {
			document.getElementById("img_src").src = BaseServiceUrl + user.protrait;
		}
		var role = user.enterprise.systemVersion;
		//alert(JSON.stringify(role));
		document.getElementById("info").innerHTML = role.versioname;
		document.getElementById("role").innerHTML = user.sysRole.sysRoleCode.role_name;
	};

	function showAction() {
		api.actionSheet({
			title: '上传图片',
			cancelTitle: '取消',
			buttons: ['拍照', '从手机相册选择']
		}, function (ret, err) {
			if (ret) {
				getPicture(ret.buttonIndex);
			}
		});
	}

	function getPicture(sourceType) {
		if (sourceType == 1) { // 拍照
			api.getPicture({
				sourceType: 'camera',
				encodingType: 'jpg',
				mediaValue: 'pic',
				allowEdit: false,
				destinationType: 'url',
				quality: 100,
				targetWidth: 200,
				targetHeight: 200,
				saveToPhotoAlbum: true
			}, function (ret, err) {
				if (ret) {
					api.showProgress({
						style: 'default',
						animationType: 'fade',
						text: '图片上传中...',
						modal: false
					});
					document.getElementById("img_src").src = ret.data; //图片链接
					uploading(ret.data)
				}
			});
		} else if (sourceType == 2) { // 从相机中选择
			api.getPicture({
				sourceType: 'album',
				encodingType: 'jpg',
				mediaValue: 'pic',
				destinationType: 'url',
				quality: 100,
				targetWidth: 200,
				targetHeight: 200
			}, function (ret, err) {
				if (ret) {
					api.showProgress({
						style: 'default',
						animationType: 'fade',
						text: '图片上传中...',
						modal: false
					});
					document.getElementById("img_src").src = ret.data; //图片链接
					uploading(ret.data)
				}
			});
		} else {
			return;
		}
	}
	//上传
	function uploading(avatar) {
		var userId = $api.getStorage("userSession").data.id
		api.ajax({
			url: BaseServiceUrl + "mobile/account/uploadImage.json",
			method: 'post',
			data: {
				files: { //图片链接上传
					file: avatar
				},
				values: { //上传参数
					id: userId,
				}
			},
			dataType: "json"
		}, function (ret, err) {
			if (ret) {
				console.log("成功")
				api.hideProgress();
			} else {
				console.log("失败")
				api.hideProgress();
			}
		})
	}


	function tongzi() {
		api.openWin({
			name: 'notice_window',
			url: 'notice_window.html',
			rect: {
				x: 0,
				y: 75,
				w: 'auto',
				h: 'auto'
			},
			bounces: true,
			delay: 200
		});
	}

	function fwxy() {
		api.openWin({
			name: 'notice_window',
			url: 'notice_window.html',
			rect: {
				x: 0,
				y: 75,
				w: 'auto',
				h: 'auto'
			},
			bounces: true,
			delay: 200
		});
	}

	$api.addEvt($api.dom("#tuichu"), "click", function () {
		api.closeWidget({
			id: "A6026560903322", //这里是应用id
			retData: {
				name: "closeWidget",
			},
			animation: {
				type: "flip",
				subType: "from_bottom",
				duration: 500,
			},
		});
	});
</script>

</html>